package org.example.api;

import lombok.extern.slf4j.Slf4j;
import org.example.model.ProductInfo;
import org.springframework.cloud.openfeign.FallbackFactory;
@Slf4j
public class ProductFallbackFactory implements FallbackFactory<ProductApi>{
    @Override
    public ProductApi create(Throwable cause) {
        return new ProductApi() {
            @Override
            public ProductInfo getProductInfo(Integer productId) {
                log.error("查询信息异常");
                return new ProductInfo();
            }
            @Override
            public String p1(Integer id) {
                 return "发⽣错误";
            }
            @Override
            public String p2(Integer id, String name) {
                return "发⽣错误";
            }
            @Override
            public String p3(ProductInfo productInfo) {
                return "发⽣错误";
            }
            @Override
            public String p4(ProductInfo productInfo) {
                return "发⽣错误";
            }
        };
    }
}

